"""author: wenyao
   data: 2020/10/20
   project: ludingji
"""

# import math
# a = int(input("请输入边长a:"))
# b = int(input("请输入边长b:"))
# c = int(input("请输入边长c:"))

#=========================if ...else...基本用法===============
# if a>0 and b>0 and c>0 and a+b>c and c+a>b and b+c>a:
#     #计算半边长
#     p = (a + b + c) / 2
#     #计算面积
#     s = math.sqrt(p*(p-a)*(p-b)*(p-c))
#     print(s)
# else:
#     print("输入不合法！")


# if a<=0 or b<=0 or c<=0 or a+b<=c or c+a<=b or c+b<=a:
#     print("输入不合法！")
# else:
#     p = (a + b + c) / 2
#     # 计算面积
#     s = math.sqrt(p * (p - a) * (p - b) * (p - c))
#     print(s)

# ==============嵌套if的使用=================================
# if a>0 and b>0 and c>0:
#     if a+b >c and a+c >b and c+b >a:
#         p = (a + b + c) / 2
#     #     # 计算面积
#         s = math.sqrt(p * (p - a) * (p - b) * (p - c))
#         print(s)
#     else:
#         print("两边之和小于第三边，不合法")
# else:
#     print("边长不能小于0")


#========== if ...elif...else...==================
# if exp1:
#     语句一
# elif exp2:
#     语句二
# elif exp3:
#     语句三
# else:
#     语句四


# if a<=0 or b<=0 or c<=0:
#     print("边长不能小于等于0，输入不合法")
# elif a+b<=c or b+c <=a or a+c <=b:
#     print("两边之和小于第三边，输入不合法")
# else:
#     p = (a + b + c) / 2
#     # 计算面积
#     s = math.sqrt(p * (p - a) * (p - b) * (p - c))
#     print(s)

#==================三元运算==========================
 #第一种方法：
 # c = a>b and a or b
 #第二种方法
   # c = a if a>b else b
 #第三种
    # if a>b:
    #     c=a
    # else:
    #     c=b

# a = "恒大雅苑|别墅 |40平米|无电梯"
# #有别墅 ,type = "别墅"
# #有车位 ，type = "车位"
# #都没有， type="高层"
# type = "别墅" if "别墅" in  a else "车位" if "车位" in  a else "高层"
# print(type)

#========= 小练习===================
username = input("please input your name:")
if username == "root":
    password = input("please input your passwd:")
    if password == "123456":
        print("登陆成功!")
    else:
        print("密码错误！")
else:
    print("用户名错误")

